package Lesson4;

import java.util.Random;
import java.util.Scanner;

public class Class5TaskEight {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		Random bool = new Random();
		
	    boolean b ;
	    
		System.out.println("Enter the array length: ");
		
		int n = sc.nextInt();
		boolean[][] arr = new boolean [n][n];
		
		int number;
		
		for (int i = 0; i < arr.length; i++)
		{
			for (int j = 0; j < arr[i].length; j++)
			{
			  arr[i][j] = bool.nextBoolean();
			}
		}
		
		for (int i = 0; i < arr.length; i++)
		{
			for (int j = 0; j < arr[i].length; j++)
			{
				System.out.print(arr[i][j] + " ");
			}
			System.out.println();
		}
		
		for (int i = 0; i < arr.length-1; i++)
		{
			for (int j = n-1; j > 0; j--)
			{
				if (i == (n-1) - j)
					{
					if(arr[i][j-1] == true)
					{
						System.out.print(" true on "+ i +" and " + (j-1)+"; " );
					}
					
					}
			}
		}
		
	}

}
